Giter Club home page Giter Club logo

contact_form_backend's Introduction

Contact Form Backend API service

This project was generated with Laravel, a PHP framework for building modern web applications.

Prerequisites

Before you begin, ensure you have PHP and Composer installed on your local machine. You will also need SQLite for local development, though you can configure another database system for production in the .env file.

Cloning the Project

To get started, clone the repository to your local machine:

git clone https://github.com/kamula/contact_form_backend.git
cd contact_form_backend

Environment Setup

After cloning the project, copy the contents from env.sample to a new .env file:

cp .env.example .env

Edit the .env file to configure your database and other environment settings. Make sure the database connection settings are appropriate for SQLite:

DB_CONNECTION=sqlite

Preparing the Database

Create an empty file named database.sqlite in the database directory of your project:

touch database/database.sqlite

Installing Dependencies

Run the following command to install the necessary PHP dependencies:

composer install

Database Migration

To set up your database schema, run the migrations:

php artisan migrate

Running the Server

Start the Laravel development server:

php artisan serve

Navigate to http://localhost:8000/ to view the application.

API Documentation

For detailed API usage and examples, please refer to our API Documentation on Postman.

Reasons for Using SQLite

  • Ease of Setup: SQLite databases are easy to set up and require no separate server process.
  • Portability: A SQLite database is stored in a single file, which can easily be copied or shared.
  • Low Resource Usage: SQLite is light on resources, which makes it perfect for development and testing environments.

Switching Database in Production

While SQLite is suitable for development, you may opt for a more robust database system in production (e.g., MySQL, PostgreSQL). Laravel's database agnostic architecture allows you to switch databases simply by updating your .env configuration.

Validations

Validation rules are applied in the ContactController to ensure that fullName, email, and message are correctly formatted and not empty, enhancing data integrity and security.

contact_form_backend's People

Contributors

kamula avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.