-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Backend setup #1
Draft
shabib87
wants to merge
14
commits into
main
Choose a base branch
from
backend-setup
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Set up project structure with src and dist directories - Configured TypeScript compiler options in tsconfig.json - Added Express.js server with basic setup - Configured ESLint and Prettier for code quality - Verified successful server startup on localhost:3000
created User entity, and generated schema with Users table
- Created `Habit` entity to manage user habits with a relationship to the `User` entity. - Updated `User` entity to include a one-to-many relationship with `Habit`.
shabib87
force-pushed
the
backend-setup
branch
from
August 18, 2024 04:09
6c3aead
to
fec9ae1
Compare
- Added `check-node-version` script to package.json to ensure correct Node.js version. - Updated README.md in habit-tracker-backend with instructions for using nvm and checking Node.js version.
- Added the `Tracker` entity to represent the tracker data. - Updated the `User` entity to include a one-to-many relationship with the `Tracker` entity. - Update the `Habit` entity to include a one-to-many relationship with the `Tracker` entity. - Update database migrations to reflect the changes.
- Added `preinstall` script to source nvm and use the Node.js version specified in .nvmrc. - This ensures consistency across different development environments by enforcing the use of Node.js version 18.x.
shabib87
changed the title
feat: Initialize backend setup with Express and TypeScript
feat: Backend setup
Aug 31, 2024
- Added ManyToOne relationship with User - Added OneToMany relationship with Tracker - Added OneToMany relationship with Reminder
- Updated README.md with available npm scripts. - Modified database schema and data in data/db.sqlite. - Updated package-lock.json and package.json with new dependencies and scripts. - Modified Habit, Reminder, Tracker, and User entities. - Added new documentation file: docs/DatabaseRelationship.md. - Added .env.sample for environment configuration. - Added new directories for DTOs and helper functions. - Added new migration file: 1725296831430-schema-update.ts.
- created basic `api/users` route with GET method and sample response. - Modified server setup in `src/bootstrap/server.ts` to include route configurations. - Added new directories and files for controllers, middlewares, routers, and utils. This commit sets up the backend server and organizes the project structure for better maintainability.
- Added DatabaseRelationship.md documentation - Created router.ts for modular route setup - Updated server.ts to use setupRoutes function - Implemented CRUD operations in userController.ts - Added userRepository.ts for database interactions - Updated user.route.ts to include all CRUD routes
- Modified router.ts to include new routes - Added habitController.ts for habit-related logic - Created habit.dto.ts for habit data transfer objects - Added habitRepository.ts for habit data handling - Created habit.route.ts for habit-related routes
… dependencies - Refactored `habitController.ts` to `src/controllers/habit/habitController.ts` - Created helper functions for user operations: - `createUser.ts` - `deleteUser.ts` - `readUser.ts` - `updateUser.ts` - Moved `userController.ts` to `src/controllers/user/userController.ts` - Added `jwt.payload.dto.ts` for JWT payload structure - Updated `user.dto.ts` with new user data structures - Modified `habitRepository.ts` and `userRepository.ts` for new structure - Updated routes in `habit.route.ts` and `user.route.ts` - Added `validateSignup.ts` for signup validation - Updated `package.json` and `package-lock.json` for new dependencies - Updated `db.sqlite` with latest schema changes
…signup responses - Updated createUser.ts to include token expiry info in signup response - Added loginUser.ts to handle user login and include token expiry info - Modified userController.ts to support new login and signup logic - Updated user.dto.ts to include UserLoginDTO - Modified user.route.ts to add login and signup routes - Enhanced encrypt.ts to support token generation - Added validateLogin.ts for login validation
…eware - Updated `habitController.ts` to integrate new helper functions - Added helper functions for habit operations: - `createHabit.ts` - `deleteHabit.ts` - `readHabit.ts` - `updateHabit.ts` - Enhanced `auth.middleware.ts` for better token verification - Updated `habitRepository.ts` to support new CRUD operations - Modified routing in `habit.route.ts` to include new endpoints
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
TBD