https://github.com/swrdna/good-night
Sleep Tracking API Service
https://github.com/swrdna/good-night
api ruby ruby-on-rails
Last synced: 6 months ago
JSON representation
Sleep Tracking API Service
- Host: GitHub
- URL: https://github.com/swrdna/good-night
- Owner: swrdna
- Created: 2025-06-07T03:46:53.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-20T15:54:59.000Z (about 1 year ago)
- Last Synced: 2025-06-20T16:49:50.170Z (about 1 year ago)
- Topics: api, ruby, ruby-on-rails
- Language: Ruby
- Homepage:
- Size: 89.8 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README




# Good Night - Sleep Tracking Application
API service for tracking sleep. Users can record their sleep sessions, follow other users and view following user's sleep activity
## Features
- Sleep session tracking
- Sleep duration
- User following system
- Sleep feed showing friends' sleep activity
## Prerequisites
- Ruby 3.4.4
- Rails 7.2
- PostgreSQL
- Docker (optional)
## Installation
1. Clone the repository
```bash
git clone https://github.com/swrdna/good-night.git
cd good-night
```
2. Install dependencies
```bash
bundle install
```
3. Create .env file
```bash
cp .env.example .env
```
4. Set up the database
```bash
rails db:create db:migrate
```
5. Data seed (optional)
```bash
rails db:seed
```
6. Start the server
```bash
rails s
```
## Running with Docker
1. Create .env file
```bash
cp .env.example .env
```
2. Run docker command
```bash
docker compose up
```
3. Setup database
```bash
docker compose exec api bin/rails db:create db:migrate
```
4. Data seed (optional)
```bash
docker compose exec api bin/rails db:seed
```
## Test
Run all the tests
```bash
rspec
```
Run specific test
```bash
rspec path/to/your/test.rb
```
## Documentation
### API
View the complete API documentation at [http://localhost:3000/docs/api](http://localhost:3000/docs/api) when the application is running.