Giter Site home page Giter Site logo

js_bbs_app's Introduction

js_bbs_app

JavaScriptで作られた簡易掲示板(Webアプリ)です。 Node.jsとExpress、各種モジュールで構築できます。 CSSフレームワークには「Buluma」を使用しています。

JavaScript Node.js

Image 1

環境構築

Node.jsの実行環境を用意した後に、このリポジトリを各自のPCの適切な場所にクローンしてください。 このプロジェクトのフォルダに移動したのち以下コマンドを使用してモジュールをインストールしてください。

npm install express

npm install crypto

npm install date-utils

npm install ejs

npm install sqlite3

またnodemonをインストールしていない場合は以下のコマンドでグローバルインストール可能です。

npm install --g nodemon

次に以下コマンドでデータベースを作成します。

sqlite3 database.sqlite3

データベースのテーブル設計は以下の通りです。

sqlite3> create table threads(id INTEGER, thread_id TEXT, thread_name TEXT, com_sum INTEGER, wrote_at NUMRIC, created_at NUMRIC, ip_address TEXT,del_flag NUMRIC DEFAULT 0, PRIMARY KEY(id AUTOINCREMENT))
sqlite3> create table users(id INTEGER, ip_address TEXT, thread_created_date NUMRIC, created_sum INTEGER,last_comment_date NUMRIC, PRIMARY KEY(id AUTOINCREMENT))

またテーブル設計のパラメータは以下の通りです

・threads

id thread_id thread_name com_sum wrote_at created_at ip_address del_flag
プライマリキー スレッドID スレッド名 レス数 最終書き込み時刻 作成時刻 作成者IPアドレス 削除フラグ

・users

id ip_address thread_created_date created_sum last_comment_date
プライマリキー 作成者IPアドレス 最終スレッド作成時刻 スレッド作成回数 最終コメント時刻

実行

次のコマンドでサーバを立ち上げ可能です。

npm start dev

上記コマンドを入力したらブラウザで「localhost:3000」にアクセスしてください。 立ち上げたサーバは「ctrl+c」を2回押すことで停止できます。

また、以下のコマンドでスレッドの書き込み回数のリセットができます。 いわゆるバッチ処理です。1日1回起動することを想定しています。

npm run batch

js_bbs_app's People

Contributors

yuron3141 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.