Skip to content

Files

Latest commit

169395b · Mar 18, 2025

History

History

blog-server

Blog Application / Server

API service for blog application. Built with authentication, middleware, dto validation, database, OOP and other concepts and principles.


Technologies:


To launch application:

I used Docker to pull and run container with MongoDB:

  1. docker pull prismagraphql/mongo-single-replica:5.0.3
  2. docker run --name mongo 
    -p 27017:27017 
    -e MONGO_INITDB_ROOT_USERNAME="user" 
    -e MONGO_INITDB_ROOT_PASSWORD="root" 
    -d prismagraphql/mongo-single-replica:5.0.3
    
  3. Copy and set up all contents for .env.local (create this file), use .env.example as template
  4. Do not forget to edit DATABASE_URL in .env.local and add there necessary port (here - 27017), user (here "user") and password (here "root")
  5. npm install
  6. npm run prisma:db-push-local
  7. npm run prisma:generate-local
  8. npm run start:dev

API Routes

  • /api/v1
    • /users
      • /:id, GET
      • /:id, PUT
      • /current, GET
    • /auth
      • /login, POST
      • /register, POST
    • /posts
      • /, GET
      • /, POST
      • /:id, GET
      • /:id, DELETE