Main base of the services used within the Make It Real platforms
- Built with Node.js and Express
- Typescript
- Prisma ORM
- REST API
- Git
- Volta.sh
- Node.js and npm Node >= 18.15 LTS, npm >= 9.5.x - Install with Volta.sh
Route | HTTP Verb | Route Middleware | Description |
---|---|---|---|
/api/healthcheck | GET | Show a simple message | |
/api/users | GET | Get list of users | |
/api/users | POST | Creates a new users | |
/api/users/:id | GET | Get a single users | |
/api/users/:id | DELETE | Deletes a user |
The use of endpoints is very simple, previously you could see a table of endpoints that you can call, if you need to create a note or log in, here we have some examples.
Request Body:
{
"email": "[email protected]",
"password": "12345"
}
Response:
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6ImNyaXN0aWFuLm1vcmVub0BtYWtlaXRyZWFsLmNhbXAiLCJpYXQiOjE2NjEyMDgwODJ9.kPdMoVUEnyX36vi606Mc1C66yWLKKAB37GLbF0gzhBo",
"profile": {
"id": "62fd77a4d25acc4a4e5df3d1",
"firstName": "CRISTIAN",
"lastName": "MORENO",
"email": "[email protected]"
}
}
Request Body:
{
"name": "cristian moreno",
"email": "[email protected]",
"password": "123456",
}
Response:
{
"name": "cristian moreno",
"email": "[email protected]",
"role": "USER",
}
-
Clone the repository:
git clone [email protected]:khriztianmoreno/backend-top-v29.git
-
Run
npm install
to install server dependencies. -
Configure the env running
cp .env.example .env
-
Update
.env
with the required info -
Run the migrations:
prisma migrate dev
-
Run
npm run dev
to start the development server.