Task Manager API is a Rails backend application paired with a React frontend for managing tasks, projects, clients, invoices, and payments. It features JSON API with JWT authentication, Sidekiq for background jobs, and currency updates via OpenExchangeRates.
- Task Management: Track tasks, time entries, rates, and payments.
- Project Management: Associate tasks with projects and clients.
- Client Management: Manage client details, contacts, and associated projects.
- Invoice Management: Create and track invoices with status updates.
- Currency Exchange: Update and convert currencies via OpenExchangeRates.
- Authentication: Secure user login using Devise with JWT tokens.
- Background Jobs: Automated currency rate updates using Sidekiq.
- Ruby: 3.1.0 or higher
- Rails: 6.1 or higher
- Node.js: 14.x or higher
- PostgreSQL: 12.x or higher
- Redis: For Sidekiq background jobs
-
Clone the repository:
git clone https://github.com/your-username/task-manager-api.git cd task-manager-api -
Install dependencies:
bundle install yarn install
-
Set up the database:
rails db:create db:migrate db:seed
-
Run the Rails server:
rails server
-
Start Sidekiq:
bundle exec sidekiq -
Access the application at
http://localhost:3000.
The API follows the JSON:API standard. Below is a brief overview of the key endpoints:
- POST
/api/v1/users/sign_in: Log in to the system. - DELETE
/api/v1/users/sign_out: Log out of the system.
- GET
/api/v1/clients: Retrieve all clients. - POST
/api/v1/clients: Create a new client. - GET
/api/v1/clients/:id: Retrieve a specific client.
- GET
/api/v1/projects: Retrieve all projects. - POST
/api/v1/projects: Create a new project.
- GET
/api/v1/tasks: Retrieve all tasks. - POST
/api/v1/tasks: Create a new task.
For detailed API documentation, please refer to the Swagger/OpenAPI docs in http://localhost:3000/docs (if configured).
Configure the following environment variables in a .env file:
# OpenExchangeRates API
OPEN_EXCHANGE_RATES_APP_ID=your_api_key
# Devise JWT Secret
DEVISE_JWT_SECRET_KEY=your_devise_jwt_secret_key
# Database
DATABASE_URL=postgres://user:password@localhost:5432/task_manager_api
# Redis
REDIS_URL=redis://localhost:6379/0The application uses RSpec for testing.
-
Run all tests:
bundle exec rspec -
Run a specific test file:
bundle exec rspec spec/models/client_spec.rb
-
Ensure the production environment is set up with PostgreSQL and Redis.
-
Configure environment variables on the server.
-
Precompile assets:
rails assets:precompile
-
Run database migrations:
rails db:migrate RAILS_ENV=production
-
Start the application using a process manager like Puma or Passenger.
This project is licensed under the MIT License. See the LICENSE file for details.
Contributions are welcome! Please submit a pull request or open an issue to suggest improvements.
Happy coding! 🎉 If you have any questions or issues, feel free to reach out!