A backend API service developed by Efemena Esegbue, Blessing Asuquo, and Daniel Nwolu.
- Project Overview
- Directory Structure
- Getting Started
- Database Setup
- Available Scripts
- API Routes
- License
- Contributors
Simbi Backend is a Node.js application built with Express and TypeScript, utilizing Prisma as an ORM for database operations. The project follows a structured architecture with separate directories for controllers, services, routes, and database configuration.
.
├── LICENSE
├── README.md
├── package-lock.json
├── package.json
├── src
│ ├── app.ts # Express application setup
│ ├── config
│ │ ├── cors.ts # CORS configuration
│ │ └── settings.ts # Application settings
│ ├── controllers # Request handlers
│ ├── database
│ │ └── db.ts # Database connection
│ ├── prisma
│ │ ├── generated # Prisma generated files
│ │ ├── migrations # Database migrations
│ │ └── schema.prisma # Prisma schema
│ ├── routes # API routes
│ ├── server.ts # Server entry point
│ ├── services # Business logic
│ └── utils
│ ├── errorClasses.ts # Custom error classes
│ ├── errorMiddleware.ts # Error handling middleware
│ └── logger.ts # Logging utility
└── tsconfig.json # TypeScript configuration
- Node.js (v16 or higher)
- npm
- A database supported by Prisma (PostgreSQL, MySQL, SQLite, etc.)
-
Clone the repository:
git clone https://github.com/Sparklingbae/Simbi-Backend.git cd Simbi-Backend -
Install dependencies:
npm install -
Create a
.envfile in the root directory with your database connection details:DATABASE_URL=your_database_connection_string PORT=3000
-
Generate Prisma Client:
npm run generate:dev -
Run database migrations:
npm run migrate:dev -
Open Prisma Studio to explore and manipulate your database:
npm run studio
npm run build- Compiles TypeScript to JavaScript in the dist directorynpm run dev- Starts the development server with hot-reloadingnpm run start- Runs the compiled JavaScript code in productionnpm run migrate:dev- Runs Prisma migrations in developmentnpm run generate:dev- Generates Prisma client in developmentnpm run migrate- Runs Prisma migrations in productionnpm run generate- Generates Prisma client in productionnpm run studio- Opens Prisma Studio for visual database management
The API routes are organized in the src/routes directory. Add your API endpoints there and connect them to the appropriate controllers.
This project is licensed under the ISC License - see the LICENSE file for details.
- Efemena Esegbue
- Daniel Nwolu
- Blessing Asuquo